package lily.phs.child;


import lily.phs.object.HereTipa;
import lily.phs.object.TwoChild;
import lily.phs.urh.R;
import lily.ui.control.MyPopupWindow;



import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.text.InputType;
import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.view.View.OnFocusChangeListener;
import android.view.WindowManager.LayoutParams;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.ScrollView;

public class OneToTwoChildView extends RelativeLayout implements OnFocusChangeListener,OnClickListener{
	View v;
	Paint paint;
	private LinearLayout ll1;
	private Context myContext;
	private int profileid;
	MyPopupWindow mPopupWindow;
	//ScrollView sv;
	private RadioButton rb_w_up_1,rb_w_up_2,rb_w_up_3,rb_w_up_4,
						rb_w_middle_1,rb_w_middle_2,rb_w_middle_3,rb_w_middle_4,
						rb_w_down_1,rb_w_down_2,rb_w_down_3,rb_w_down_4,
						rb_h_up_1,rb_h_up_2,rb_h_up_3,rb_h_up_4,
						rb_h_middle_1,rb_h_middle_2,rb_h_middle_3,rb_h_middle_4,
						rb_h_down_1,rb_h_down_2,rb_h_down_3,rb_h_down_4,
						rb_hong_1,rb_hong_2,rb_hong_3,rb_hong_4,rb_other_1,rb_other_2,rb_other_3,rb_other_4,
						rb_skin_no_1,rb_skin_no_2,rb_skin_no_3,rb_skin_no_4,
						rb_skin_yes_1,rb_skin_yes_2,rb_skin_yes_3,rb_skin_yes_4,
						rb_qianxin_bihe_1,rb_qianxin_bihe_2,rb_qianxin_bihe_3,
						rb_qianxin_weibi_1,rb_qianxin_weibi_2,rb_qianxin_weibi_3,
						rb_eye_no_1,rb_eye_no_2,rb_eye_no_3,rb_eye_no_4,
						rb_eye_yes_1,rb_eye_yes_2,rb_eye_yes_3,rb_eye_yes_4,
						rb_ear_no_1,rb_ear_no_2,rb_ear_no_3,rb_ear_no_4,
						rb_ear_yes_1,rb_ear_yes_2,rb_ear_yes_3,rb_ear_yes_4,
						rb_hearing_pass_1,rb_hearing_pass_3,rb_hearing_nopass_1,rb_hearing_nopass_3,
						rb_card_no_1,rb_card_no_2,rb_card_no_3,rb_card_no_4,
						rb_card_yes_1,rb_card_yes_2,rb_card_yes_3,rb_card_yes_4,
						rb_fubu_no_1,rb_fubu_no_2,rb_fubu_no_3,rb_fubu_no_4,
						rb_fubu_yes_1,rb_fubu_yes_2,rb_fubu_yes_3,rb_fubu_yes_4,
						rb_leg_no_1,rb_leg_no_2,rb_leg_no_3,rb_leg_no_4,
						rb_leg_yes_1,rb_leg_yes_2,rb_leg_yes_3,rb_leg_yes_4;
	private EditText et_name,et_id,
					 et_date_1,et_date_2,et_date_3,et_date_4,
					 et_weight_1,et_weight_2,et_weight_3,et_weight_4,
					 et_height_1,et_height_2,et_height_3,et_height_4,
					 et_qianxin_left_1,et_qianxin_left_2,et_qianxin_left_3,
					 et_qianxin_right_1,et_qianxin_right_2,et_qianxin_right_3,
					 et_yashu_1,et_yashu_2,et_yashu_3,et_yashu_4,
					 et_quchi_1,et_quchi_2,et_quchi_3,et_quchi_4;
	
	private RadioGroup rg_weight_1,rg_weight_2,rg_weight_3,rg_weight_4,
					   rg_height_1,rg_height_2,rg_height_3,rg_height_4,
					   rg_face_1,rg_face_2,rg_face_3,rg_face_4,
					   rg_skin_1,rg_skin_2,rg_skin_3,rg_skin_4,
					   rg_qianxin_1,rg_qianxin_2,rg_qianxin_3,
					   rg_eye_1,rg_eye_2,rg_eye_3,rg_eye_4,
					   rg_ear_1,rg_ear_2,rg_ear_3,rg_ear_4,
					   rg_hearing_1,rg_hearing_3,
					   rg_card_1,rg_card_2,rg_card_3,rg_card_4,
					   rg_fubu_1,rg_fubu_2,rg_fubu_3,rg_fubu_4,
					   rg_leg_1,rg_leg_2,rg_leg_3,rg_leg_4;
					   
	HereTipa ht;
	TwoChild tc1,tc2,tc3,tc4;
	
	public OneToTwoChildView(Context context,int pro) {
		super(context);
		myContext=context;
		this.profileid=pro;
		paint=new Paint();
		paint.setStyle(Paint.Style.STROKE);
        paint.setColor(Color.BLACK);
        this.setBackgroundColor(Color.WHITE);
	}
	
	public void findWeidget(){
		LayoutInflater factory = LayoutInflater.from(myContext);
        v = factory.inflate(R.layout.onetotwo_child, null);
        
        ll1=(LinearLayout)v.findViewById(R.id.ll);
		//sv=(ScrollView)v.findViewById(R.id.ScrollView01);
		
		et_name=(EditText)v.findViewById(R.id.et_tc_name);
		et_id=(EditText)v.findViewById(R.id.et_tc_id);
		et_name.setInputType(InputType.TYPE_NULL);
		et_id.setInputType(InputType.TYPE_NULL);
		et_date_1=(EditText)v.findViewById(R.id.et_tc_date_1);
		et_date_2=(EditText)v.findViewById(R.id.et_tc_date_2);
		et_date_3=(EditText)v.findViewById(R.id.et_tc_date_3);
		et_date_4=(EditText)v.findViewById(R.id.et_tc_date_4);
		et_date_1.setInputType(InputType.TYPE_NULL);
		et_date_2.setInputType(InputType.TYPE_NULL);
		et_date_3.setInputType(InputType.TYPE_NULL);
		et_date_4.setInputType(InputType.TYPE_NULL);
		et_date_1.setOnClickListener(this);
		et_date_1.setOnFocusChangeListener(this);
		et_date_2.setOnClickListener(this);
		et_date_2.setOnFocusChangeListener(this);
		et_date_3.setOnClickListener(this);
		et_date_3.setOnFocusChangeListener(this);
		et_date_4.setOnClickListener(this);
		et_date_4.setOnFocusChangeListener(this);
		et_weight_1=(EditText)v.findViewById(R.id.et_tc_weight_1);
		et_weight_2=(EditText)v.findViewById(R.id.et_tc_weight_2);
		et_weight_3=(EditText)v.findViewById(R.id.et_tc_weight_3);
		et_weight_4=(EditText)v.findViewById(R.id.et_tc_weight_4);
		rg_weight_1=(RadioGroup)v.findViewById(R.id.rg_tc_weight_1);
		rg_weight_2=(RadioGroup)v.findViewById(R.id.rg_tc_weight_2);
		rg_weight_3=(RadioGroup)v.findViewById(R.id.rg_tc_weight_3);
		rg_weight_4=(RadioGroup)v.findViewById(R.id.rg_tc_weight_4);
		rb_w_up_1=(RadioButton)v.findViewById(R.id.rb_tc_weight_up_1);
		rb_w_up_2=(RadioButton)v.findViewById(R.id.rb_tc_weight_up_2);
		rb_w_up_3=(RadioButton)v.findViewById(R.id.rb_tc_weight_up_3);
		rb_w_up_4=(RadioButton)v.findViewById(R.id.rb_tc_weight_up_4);
		rb_w_middle_1=(RadioButton)v.findViewById(R.id.rb_tc_weight_middle_1);
		rb_w_middle_2=(RadioButton)v.findViewById(R.id.rb_tc_weight_middle_2);
		rb_w_middle_3=(RadioButton)v.findViewById(R.id.rb_tc_weight_middle_3);
		rb_w_middle_4=(RadioButton)v.findViewById(R.id.rb_tc_weight_middle_4);
		rb_w_down_1=(RadioButton)v.findViewById(R.id.rb_tc_weight_down_1);
		rb_w_down_2=(RadioButton)v.findViewById(R.id.rb_tc_weight_down_2);
		rb_w_down_3=(RadioButton)v.findViewById(R.id.rb_tc_weight_down_3);
		rb_w_down_4=(RadioButton)v.findViewById(R.id.rb_tc_weight_down_4);
		et_height_1=(EditText)v.findViewById(R.id.et_tc_height_1);
		et_height_2=(EditText)v.findViewById(R.id.et_tc_height_2);
		et_height_3=(EditText)v.findViewById(R.id.et_tc_height_3);
		et_height_4=(EditText)v.findViewById(R.id.et_tc_height_4);
		rg_height_1=(RadioGroup)v.findViewById(R.id.rg_tc_height_1);
		rg_height_2=(RadioGroup)v.findViewById(R.id.rg_tc_height_2);
		rg_height_3=(RadioGroup)v.findViewById(R.id.rg_tc_height_3);
		rg_height_4=(RadioGroup)v.findViewById(R.id.rg_tc_height_4);
		rb_h_up_1=(RadioButton)v.findViewById(R.id.rb_tc_height_up_1);
		rb_h_up_2=(RadioButton)v.findViewById(R.id.rb_tc_height_up_2);
		rb_h_up_3=(RadioButton)v.findViewById(R.id.rb_tc_height_up_3);
		rb_h_up_4=(RadioButton)v.findViewById(R.id.rb_tc_height_up_4);
		rb_h_middle_1=(RadioButton)v.findViewById(R.id.rb_tc_height_middle_1);
		rb_h_middle_2=(RadioButton)v.findViewById(R.id.rb_tc_height_middle_2);
		rb_h_middle_3=(RadioButton)v.findViewById(R.id.rb_tc_height_middle_3);
		rb_h_middle_4=(RadioButton)v.findViewById(R.id.rb_tc_height_middle_4);
		rb_h_down_1=(RadioButton)v.findViewById(R.id.rb_tc_height_down_1);
		rb_h_down_2=(RadioButton)v.findViewById(R.id.rb_tc_height_down_2);
		rb_h_down_3=(RadioButton)v.findViewById(R.id.rb_tc_height_down_3);
		rb_h_down_4=(RadioButton)v.findViewById(R.id.rb_tc_height_down_4);
		rg_face_1=(RadioGroup)v.findViewById(R.id.rg_tc_face_1);
		rg_face_2=(RadioGroup)v.findViewById(R.id.rg_tc_face_2);
		rg_face_3=(RadioGroup)v.findViewById(R.id.rg_tc_face_3);
		rg_face_4=(RadioGroup)v.findViewById(R.id.rg_tc_face_4);
		rb_hong_1=(RadioButton)v.findViewById(R.id.rb_tc_face_hong_1);
		rb_hong_2=(RadioButton)v.findViewById(R.id.rb_tc_face_hong_2);
		rb_hong_3=(RadioButton)v.findViewById(R.id.rb_tc_face_hong_3);
		rb_hong_4=(RadioButton)v.findViewById(R.id.rb_tc_face_hong_4);
		rb_other_1=(RadioButton)v.findViewById(R.id.rb_tc_face_other_1);
		rb_other_2=(RadioButton)v.findViewById(R.id.rb_tc_face_other_2);
		rb_other_3=(RadioButton)v.findViewById(R.id.rb_tc_face_other_3);
		rb_other_4=(RadioButton)v.findViewById(R.id.rb_tc_face_other_4);
		rg_skin_1=(RadioGroup)v.findViewById(R.id.rg_tc_skin_1);
		rg_skin_2=(RadioGroup)v.findViewById(R.id.rg_tc_skin_2);
		rg_skin_3=(RadioGroup)v.findViewById(R.id.rg_tc_skin_3);
		rg_skin_4=(RadioGroup)v.findViewById(R.id.rg_tc_skin_4);
		rb_skin_no_1=(RadioButton)v.findViewById(R.id.rb_tc_skin_no_1);
		rb_skin_no_2=(RadioButton)v.findViewById(R.id.rb_tc_skin_no_2);
		rb_skin_no_3=(RadioButton)v.findViewById(R.id.rb_tc_skin_no_3);
		rb_skin_no_4=(RadioButton)v.findViewById(R.id.rb_tc_skin_no_4);
		rb_skin_yes_1=(RadioButton)v.findViewById(R.id.rb_tc_skin_yes_1);
		rb_skin_yes_2=(RadioButton)v.findViewById(R.id.rb_tc_skin_yes_2);
		rb_skin_yes_3=(RadioButton)v.findViewById(R.id.rb_tc_skin_yes_3);
		rb_skin_yes_4=(RadioButton)v.findViewById(R.id.rb_tc_skin_yes_4);
		rg_qianxin_1=(RadioGroup)v.findViewById(R.id.rg_tc_qianxin_1);
		rg_qianxin_2=(RadioGroup)v.findViewById(R.id.rg_tc_qianxin_2);
		rg_qianxin_3=(RadioGroup)v.findViewById(R.id.rg_tc_qianxin_3);
		rb_qianxin_bihe_1=(RadioButton)v.findViewById(R.id.rb_tc_qianxin_bihe_1);
		rb_qianxin_bihe_2=(RadioButton)v.findViewById(R.id.rb_tc_qianxin_bihe_2);
		rb_qianxin_bihe_3=(RadioButton)v.findViewById(R.id.rb_tc_qianxin_bihe_3);
		rb_qianxin_weibi_1=(RadioButton)v.findViewById(R.id.rb_tc_qianxin_weibi_1);
		rb_qianxin_weibi_2=(RadioButton)v.findViewById(R.id.rb_tc_qianxin_weibi_2);
		rb_qianxin_weibi_3=(RadioButton)v.findViewById(R.id.rb_tc_qianxin_weibi_3);
		et_qianxin_left_1=(EditText)v.findViewById(R.id.et_tc_qianxin_left_1);
		et_qianxin_left_2=(EditText)v.findViewById(R.id.et_tc_qianxin_left_2);
		et_qianxin_left_3=(EditText)v.findViewById(R.id.et_tc_qianxin_left_3);
		et_qianxin_right_1=(EditText)v.findViewById(R.id.et_tc_qianxin_right_1);
		et_qianxin_right_2=(EditText)v.findViewById(R.id.et_tc_qianxin_right_2);
		et_qianxin_right_3=(EditText)v.findViewById(R.id.et_tc_qianxin_right_3);
		rg_eye_1=(RadioGroup)v.findViewById(R.id.rg_tc_eye_1);
		rg_eye_2=(RadioGroup)v.findViewById(R.id.rg_tc_eye_2);
		rg_eye_3=(RadioGroup)v.findViewById(R.id.rg_tc_eye_3);
		rg_eye_4=(RadioGroup)v.findViewById(R.id.rg_tc_eye_4);
		rb_eye_no_1=(RadioButton)v.findViewById(R.id.rb_tc_eye_no_1);
		rb_eye_no_2=(RadioButton)v.findViewById(R.id.rb_tc_eye_no_2);
		rb_eye_no_3=(RadioButton)v.findViewById(R.id.rb_tc_eye_no_3);
		rb_eye_no_4=(RadioButton)v.findViewById(R.id.rb_tc_eye_no_4);
		rb_eye_yes_1=(RadioButton)v.findViewById(R.id.rb_tc_eye_yes_1);
		rb_eye_yes_2=(RadioButton)v.findViewById(R.id.rb_tc_eye_yes_2);
		rb_eye_yes_3=(RadioButton)v.findViewById(R.id.rb_tc_eye_yes_3);
		rb_eye_yes_4=(RadioButton)v.findViewById(R.id.rb_tc_eye_yes_4);
		rg_ear_1=(RadioGroup)v.findViewById(R.id.rg_tc_ear_1);
		rg_ear_2=(RadioGroup)v.findViewById(R.id.rg_tc_ear_2);
		rg_ear_3=(RadioGroup)v.findViewById(R.id.rg_tc_ear_3);
		rg_ear_4=(RadioGroup)v.findViewById(R.id.rg_tc_ear_4);
		rb_ear_no_1=(RadioButton)v.findViewById(R.id.rb_tc_ear_no_1);
		rb_ear_no_2=(RadioButton)v.findViewById(R.id.rb_tc_ear_no_2);
		rb_ear_no_3=(RadioButton)v.findViewById(R.id.rb_tc_ear_no_3);
		rb_ear_no_4=(RadioButton)v.findViewById(R.id.rb_tc_ear_no_4);
		rb_ear_yes_1=(RadioButton)v.findViewById(R.id.rb_tc_ear_yes_1);
		rb_ear_yes_2=(RadioButton)v.findViewById(R.id.rb_tc_ear_yes_2);
		rb_ear_yes_3=(RadioButton)v.findViewById(R.id.rb_tc_ear_yes_3);
		rb_ear_yes_4=(RadioButton)v.findViewById(R.id.rb_tc_ear_yes_4);
		rg_hearing_1=(RadioGroup)v.findViewById(R.id.rg_tc_hearing_1);
		rg_hearing_3=(RadioGroup)v.findViewById(R.id.rg_tc_hearing_3);
		rb_hearing_pass_1=(RadioButton)v.findViewById(R.id.rb_tc_hearing_pass_1);
		rb_hearing_pass_3=(RadioButton)v.findViewById(R.id.rb_tc_hearing_pass_3);
		rb_hearing_nopass_1=(RadioButton)v.findViewById(R.id.rb_tc_hearing_nopass_1);
		rb_hearing_nopass_3=(RadioButton)v.findViewById(R.id.rb_tc_hearing_nopass_3);
		et_yashu_1=(EditText)v.findViewById(R.id.et_tc_yashu_1);
		et_yashu_2=(EditText)v.findViewById(R.id.et_tc_yashu_2);
		et_yashu_3=(EditText)v.findViewById(R.id.et_tc_yashu_3);
		et_yashu_4=(EditText)v.findViewById(R.id.et_tc_yashu_4);
		et_quchi_1=(EditText)v.findViewById(R.id.et_tc_quchi_1);
		et_quchi_2=(EditText)v.findViewById(R.id.et_tc_quchi_2);
		et_quchi_3=(EditText)v.findViewById(R.id.et_tc_quchi_3);
		et_quchi_4=(EditText)v.findViewById(R.id.et_tc_quchi_4);
		rg_card_1=(RadioGroup)v.findViewById(R.id.rg_tc_card_1);
		rg_card_2=(RadioGroup)v.findViewById(R.id.rg_tc_card_2);
		rg_card_3=(RadioGroup)v.findViewById(R.id.rg_tc_card_3);
		rg_card_4=(RadioGroup)v.findViewById(R.id.rg_tc_card_4);
		rb_card_no_1=(RadioButton)v.findViewById(R.id.rb_tc_card_no_1);
		rb_card_no_2=(RadioButton)v.findViewById(R.id.rb_tc_card_no_2);
		rb_card_no_3=(RadioButton)v.findViewById(R.id.rb_tc_card_no_3);
		rb_card_no_4=(RadioButton)v.findViewById(R.id.rb_tc_card_no_4);
		rb_card_yes_1=(RadioButton)v.findViewById(R.id.rb_tc_card_yes_1);
		rb_card_yes_2=(RadioButton)v.findViewById(R.id.rb_tc_card_yes_2);
		rb_card_yes_3=(RadioButton)v.findViewById(R.id.rb_tc_card_yes_3);
		rb_card_yes_4=(RadioButton)v.findViewById(R.id.rb_tc_card_yes_4);
		rg_fubu_1=(RadioGroup)v.findViewById(R.id.rg_tc_fubu_1);
		rg_fubu_2=(RadioGroup)v.findViewById(R.id.rg_tc_fubu_2);
		rg_fubu_3=(RadioGroup)v.findViewById(R.id.rg_tc_fubu_3);
		rg_fubu_4=(RadioGroup)v.findViewById(R.id.rg_tc_fubu_4);
		rb_fubu_no_1=(RadioButton)v.findViewById(R.id.rb_tc_fubu_no_1);
		rb_fubu_no_2=(RadioButton)v.findViewById(R.id.rb_tc_fubu_no_2);
		rb_fubu_no_3=(RadioButton)v.findViewById(R.id.rb_tc_fubu_no_3);
		rb_fubu_no_4=(RadioButton)v.findViewById(R.id.rb_tc_fubu_no_4);
		rb_fubu_yes_1=(RadioButton)v.findViewById(R.id.rb_tc_fubu_yes_1);
		rb_fubu_yes_2=(RadioButton)v.findViewById(R.id.rb_tc_fubu_yes_2);
		rb_fubu_yes_3=(RadioButton)v.findViewById(R.id.rb_tc_fubu_yes_3);
		rb_fubu_yes_4=(RadioButton)v.findViewById(R.id.rb_tc_fubu_yes_4);
		rg_leg_1=(RadioGroup)v.findViewById(R.id.rg_tc_leg_1);
		rg_leg_2=(RadioGroup)v.findViewById(R.id.rg_tc_leg_2);
		rg_leg_3=(RadioGroup)v.findViewById(R.id.rg_tc_leg_3);
		rg_leg_4=(RadioGroup)v.findViewById(R.id.rg_tc_leg_4);
		rb_leg_no_1=(RadioButton)v.findViewById(R.id.rb_tc_leg_no_1);
		rb_leg_no_2=(RadioButton)v.findViewById(R.id.rb_tc_leg_no_2);
		rb_leg_no_3=(RadioButton)v.findViewById(R.id.rb_tc_leg_no_3);
		rb_leg_no_4=(RadioButton)v.findViewById(R.id.rb_tc_leg_no_4);
		rb_leg_yes_1=(RadioButton)v.findViewById(R.id.rb_tc_leg_yes_1);
		rb_leg_yes_2=(RadioButton)v.findViewById(R.id.rb_tc_leg_yes_2);
		rb_leg_yes_3=(RadioButton)v.findViewById(R.id.rb_tc_leg_yes_3);
		rb_leg_yes_4=(RadioButton)v.findViewById(R.id.rb_tc_leg_yes_4);
		/*LayoutParams lp=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
		this.addView(v,lp);
		
		MyView mv=new MyView(myContext);
		this.addView(mv,lp);*/
		ht=new HereTipa(myContext);
		ht.selectNameAndCode(profileid);
		tc1=new TwoChild(myContext);
		tc1.selectTwoChild(profileid, 1);
		tc2=new TwoChild(myContext);
		tc2.selectTwoChild(profileid, 2);
		tc3=new TwoChild(myContext);
		tc3.selectTwoChild(profileid, 3);
		tc4=new TwoChild(myContext);
		tc4.selectTwoChild(profileid, 4);
	}
	
	public void selectData(){
		tc1.selectTwoChild(profileid, 1);
		tc2.selectTwoChild(profileid, 2);
		tc3.selectTwoChild(profileid, 3);
		tc4.selectTwoChild(profileid, 4);
	}
	
	public void addToView(){
		LayoutParams lp=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
		this.addView(v,lp);
		
		MyView mv=new MyView(myContext);
		this.addView(mv,lp);
	}
	
	public void initView(){
		//ht=new HereTipa(myContext);
		//ht.selectNameAndCode(profileid);
		if(ht.getHeti_name()!=null){
			et_name.setText(ht.getHeti_name());
		}
		if(ht.getHeti_here_id()!=null){
			et_id.setText(ht.getHeti_here_id());
		}
		//TwoChild tc=new TwoChild(myContext);
		//tc.selectTwoChild(profileid, 1);
		et_date_1.setText(tc1.getTwch_date());
		if(tc1.getTwch_weig_value()>0){
			et_weight_1.setText(tc1.getTwch_weig_value()+"");
		}
		if(tc1.getTwch_weig_choi()>0){
			switch(tc1.getTwch_weig_choi()){
			case 1:
				rg_weight_1.check(0);
				rb_w_up_1.setChecked(true);
				break;
			case 2:
				rg_weight_1.check(1);
				rb_w_middle_1.setChecked(true);
				break;
			case 3:
				rg_weight_1.check(2);
				rb_w_down_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_heig_value()>0){
			et_height_1.setText(tc1.getTwch_heig_value()+"");
		}
		if(tc1.getTwch_heig_choi()>0){
			switch(tc1.getTwch_heig_choi()){
			case 1:
				rg_height_1.check(0);
				rb_h_up_1.setChecked(true);
				break;
			case 2:
				rg_height_1.check(1);
				rb_h_middle_1.setChecked(true);
				break;
			case 3:
				rg_height_1.check(2);
				rb_h_down_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_complexion()>0){
			switch(tc1.getTwch_complexion()){
			case 1:
				rg_face_1.check(0);
				rb_hong_1.setChecked(true);
				break;
			case 2:
				rg_face_1.check(1);
				rb_other_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_skin()>0){
			switch(tc1.getTwch_skin()){
			case 1:
				rg_skin_1.check(0);
				rb_skin_no_1.setChecked(true);
				break;
			case 2:
				rg_skin_1.check(1);
				rb_skin_yes_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_bregma_choi()>0){
			switch(tc1.getTwch_bregma_choi()){
			case 1:
				rg_qianxin_1.check(0);
				rb_qianxin_bihe_1.setChecked(true);
				break;
			case 2:
				rg_qianxin_1.check(1);
				rb_qianxin_weibi_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_bregma_left()>0){
			et_qianxin_left_1.setText(tc1.getTwch_bregma_left()+"");
		}
		if(tc1.getTwch_bregma_right()>0){
			et_qianxin_right_1.setText(tc1.getTwch_bregma_right()+"");
		}
		if(tc1.getTwch_eye_appearance()>0){
			switch(tc1.getTwch_eye_appearance()){
			case 1:
				rg_eye_1.check(0);
				rb_eye_no_1.setChecked(true);
				break;
			case 2:
				rg_eye_1.check(1);
				rb_eye_yes_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_ear_appearance()>0){
			switch(tc1.getTwch_ear_appearance()){
			case 1:
				rg_ear_1.check(0);
				rb_ear_no_1.setChecked(true);
				break;
			case 2:
				rg_ear_1.check(1);
				rb_ear_yes_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_hearing()>0){
			switch(tc1.getTwch_hearing()){
			case 1:
				rg_hearing_1.check(0);
				rb_hearing_pass_1.setChecked(true);
				break;
			case 2:
				rg_hearing_1.check(1);
				rb_hearing_nopass_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_teething()>0){
			et_yashu_1.setText(tc1.getTwch_teething()+"");
		}
		if(tc1.getTwch_cavity()>0){
			et_quchi_1.setText(tc1.getTwch_cavity()+"");
		}
		if(tc1.getTwch_card()>0){
			switch(tc1.getTwch_card()){
			case 1:
				rg_card_1.check(0);
				rb_card_no_1.setChecked(true);
				break;
			case 2:
				rg_card_1.check(1);
				rb_card_yes_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_abdomen()>0){
			switch(tc1.getTwch_abdomen()){
			case 1:
				rg_fubu_1.check(0);
				rb_fubu_no_1.setChecked(true);
				break;
			case 2:
				rg_fubu_1.check(1);
				rb_fubu_yes_1.setChecked(true);
				break;
			}
		}
		if(tc1.getTwch_legs()>0){
			switch(tc1.getTwch_legs()){
			case 1:
				rg_leg_1.check(0);
				rb_leg_no_1.setChecked(true);
				break;
			case 2:
				rg_leg_1.check(1);
				rb_leg_yes_1.setChecked(true);
			}
		}
		//18
		//tc.selectTwoChild(profileid, 2);
		et_date_2.setText(tc2.getTwch_date());
		if(tc2.getTwch_weig_value()>0){
			et_weight_2.setText(tc2.getTwch_weig_value()+"");
		}
		if(tc2.getTwch_weig_choi()>0){
			switch(tc2.getTwch_weig_choi()){
			case 1:
				rg_weight_2.check(0);
				rb_w_up_2.setChecked(true);
				break;
			case 2:
				rg_weight_2.check(1);
				rb_w_middle_2.setChecked(true);
				break;
			case 3:
				rg_weight_2.check(2);
				rb_w_down_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_heig_value()>0){
			et_height_2.setText(tc2.getTwch_heig_value()+"");
		}
		if(tc2.getTwch_heig_choi()>0){
			switch(tc2.getTwch_heig_choi()){
			case 1:
				rg_height_2.check(0);
				rb_h_up_2.setChecked(true);
				break;
			case 2:
				rg_height_2.check(1);
				rb_h_middle_2.setChecked(true);
				break;
			case 3:
				rg_height_2.check(2);
				rb_h_down_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_complexion()>0){
			switch(tc2.getTwch_complexion()){
			case 1:
				rg_face_2.check(0);
				rb_hong_2.setChecked(true);
				break;
			case 2:
				rg_face_2.check(1);
				rb_other_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_skin()>0){
			switch(tc2.getTwch_skin()){
			case 1:
				rg_skin_2.check(0);
				rb_skin_no_2.setChecked(true);
				break;
			case 2:
				rg_skin_2.check(1);
				rb_skin_yes_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_bregma_choi()>0){
			switch(tc2.getTwch_bregma_choi()){
			case 1:
				rg_qianxin_2.check(0);
				rb_qianxin_bihe_2.setChecked(true);
				break;
			case 2:
				rg_qianxin_2.check(1);
				rb_qianxin_weibi_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_bregma_left()>0){
			et_qianxin_left_2.setText(tc2.getTwch_bregma_left()+"");
		}
		if(tc2.getTwch_bregma_right()>0){
			et_qianxin_right_2.setText(tc2.getTwch_bregma_right()+"");
		}
		if(tc2.getTwch_eye_appearance()>0){
			switch(tc2.getTwch_eye_appearance()){
			case 1:
				rg_eye_2.check(0);
				rb_eye_no_2.setChecked(true);
				break;
			case 2:
				rg_eye_2.check(1);
				rb_eye_yes_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_ear_appearance()>0){
			switch(tc2.getTwch_ear_appearance()){
			case 1:
				rg_ear_2.check(0);
				rb_ear_no_2.setChecked(true);
				break;
			case 2:
				rg_ear_2.check(1);
				rb_ear_yes_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_teething()>0){
			et_yashu_2.setText(tc2.getTwch_teething()+"");
		}
		if(tc2.getTwch_cavity()>0){
			et_quchi_2.setText(tc2.getTwch_cavity()+"");
		}
		if(tc2.getTwch_card()>0){
			switch(tc2.getTwch_card()){
			case 1:
				rg_card_2.check(0);
				rb_card_no_2.setChecked(true);
				break;
			case 2:
				rg_card_2.check(1);
				rb_card_yes_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_abdomen()>0){
			switch(tc2.getTwch_abdomen()){
			case 1:
				rg_fubu_2.check(0);
				rb_fubu_no_2.setChecked(true);
				break;
			case 2:
				rg_fubu_2.check(1);
				rb_fubu_yes_2.setChecked(true);
				break;
			}
		}
		if(tc2.getTwch_legs()>0){
			switch(tc2.getTwch_legs()){
			case 1:
				rg_leg_2.check(0);
				rb_leg_no_2.setChecked(true);
				break;
			case 2:
				rg_leg_2.check(1);
				rb_leg_yes_2.setChecked(true);
			}
		}
		//24
		//tc.selectTwoChild(profileid, 3);
		et_date_3.setText(tc3.getTwch_date());
		if(tc3.getTwch_weig_value()>0){
			et_weight_3.setText(tc3.getTwch_weig_value()+"");
		}
		if(tc3.getTwch_weig_choi()>0){
			switch(tc3.getTwch_weig_choi()){
			case 1:
				rg_weight_3.check(0);
				rb_w_up_3.setChecked(true);
				break;
			case 2:
				rg_weight_3.check(1);
				rb_w_middle_3.setChecked(true);
				break;
			case 3:
				rg_weight_3.check(2);
				rb_w_down_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_heig_value()>0){
			et_height_3.setText(tc3.getTwch_heig_value()+"");
		}
		if(tc3.getTwch_heig_choi()>0){
			switch(tc3.getTwch_heig_choi()){
			case 1:
				rg_height_3.check(0);
				rb_h_up_3.setChecked(true);
				break;
			case 2:
				rg_height_3.check(1);
				rb_h_middle_3.setChecked(true);
				break;
			case 3:
				rg_height_3.check(2);
				rb_h_down_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_complexion()>0){
			switch(tc3.getTwch_complexion()){
			case 1:
				rg_face_3.check(0);
				rb_hong_3.setChecked(true);
				break;
			case 2:
				rg_face_3.check(1);
				rb_other_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_skin()>0){
			switch(tc3.getTwch_skin()){
			case 1:
				rg_skin_3.check(0);
				rb_skin_no_3.setChecked(true);
				break;
			case 2:
				rg_skin_3.check(1);
				rb_skin_yes_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_bregma_choi()>0){
			switch(tc3.getTwch_bregma_choi()){
			case 1:
				rg_qianxin_3.check(0);
				rb_qianxin_bihe_3.setChecked(true);
				break;
			case 2:
				rg_qianxin_3.check(1);
				rb_qianxin_weibi_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_bregma_left()>0){
			et_qianxin_left_3.setText(tc3.getTwch_bregma_left()+"");
		}
		if(tc3.getTwch_bregma_right()>0){
			et_qianxin_right_3.setText(tc3.getTwch_bregma_right()+"");
		}
		if(tc3.getTwch_eye_appearance()>0){
			switch(tc3.getTwch_eye_appearance()){
			case 1:
				rg_eye_3.check(0);
				rb_eye_no_3.setChecked(true);
				break;
			case 2:
				rg_eye_3.check(1);
				rb_eye_yes_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_ear_appearance()>0){
			switch(tc3.getTwch_ear_appearance()){
			case 1:
				rg_ear_3.check(0);
				rb_ear_no_3.setChecked(true);
				break;
			case 2:
				rg_ear_3.check(1);
				rb_ear_yes_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_hearing()>0){
			switch(tc3.getTwch_hearing()){
			case 1:
				rg_hearing_3.check(0);
				rb_hearing_pass_3.setChecked(true);
				break;
			case 2:
				rg_hearing_3.check(1);
				rb_hearing_nopass_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_teething()>0){
			et_yashu_3.setText(tc3.getTwch_teething()+"");
		}
		if(tc3.getTwch_cavity()>0){
			et_quchi_3.setText(tc3.getTwch_cavity()+"");
		}
		if(tc3.getTwch_card()>0){
			switch(tc3.getTwch_card()){
			case 1:
				rg_card_3.check(0);
				rb_card_no_3.setChecked(true);
				break;
			case 2:
				rg_card_3.check(1);
				rb_card_yes_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_abdomen()>0){
			switch(tc3.getTwch_abdomen()){
			case 1:
				rg_fubu_3.check(0);
				rb_fubu_no_3.setChecked(true);
				break;
			case 2:
				rg_fubu_3.check(1);
				rb_fubu_yes_3.setChecked(true);
				break;
			}
		}
		if(tc3.getTwch_legs()>0){
			switch(tc3.getTwch_legs()){
			case 1:
				rg_leg_3.check(0);
				rb_leg_no_3.setChecked(true);
				break;
			case 2:
				rg_leg_3.check(1);
				rb_leg_yes_3.setChecked(true);
			}
		}
		//30
		//tc.selectTwoChild(profileid, 4);
		et_date_4.setText(tc4.getTwch_date());
		if(tc4.getTwch_weig_value()>0){
			et_weight_4.setText(tc4.getTwch_weig_value()+"");
		}
		if(tc4.getTwch_weig_choi()>0){
			switch(tc4.getTwch_weig_choi()){
			case 1:
				rg_weight_4.check(0);
				rb_w_up_4.setChecked(true);
				break;
			case 2:
				rg_weight_4.check(1);
				rb_w_middle_4.setChecked(true);
				break;
			case 3:
				rg_weight_4.check(2);
				rb_w_down_4.setChecked(true);
				break;
			}
		}
		if(tc4.getTwch_heig_value()>0){
			et_height_4.setText(tc4.getTwch_heig_value()+"");
		}
		if(tc4.getTwch_heig_choi()>0){
			switch(tc4.getTwch_heig_choi()){
			case 1:
				rg_height_4.check(0);
				rb_h_up_4.setChecked(true);
				break;
			case 2:
				rg_height_4.check(1);
				rb_h_middle_4.setChecked(true);
				break;
			case 3:
				rg_height_4.check(2);
				rb_h_down_4.setChecked(true);
				break;
			}
		}
		if(tc4.getTwch_complexion()>0){
			Log.e("tag","tc4.getTwch_complexion()="+tc4.getTwch_complexion() );
			switch(tc4.getTwch_complexion()){
			case 1:
				rg_face_4.check(0);
				rb_hong_4.setChecked(true);
				break;
			case 2:
				Log.e("tag1","rb_other_4.isChecked()="+rb_other_4.isChecked() );
				rg_face_4.check(1);
				rb_other_4.setChecked(true);
				Log.e("tag2","rb_other_4.isChecked()="+rb_other_4.isChecked() );
				break;
			}
		}
		if(tc4.getTwch_skin()>0){
			switch(tc4.getTwch_skin()){
			case 1:
				rg_skin_4.check(0);
				rb_skin_no_4.setChecked(true);
				break;
			case 2:
				rg_skin_4.check(1);
				rb_skin_yes_4.setChecked(true);
				break;
			}
		}
		
		if(tc4.getTwch_eye_appearance()>0){
			switch(tc4.getTwch_eye_appearance()){
			case 1:
				rg_eye_4.check(0);
				rb_eye_no_4.setChecked(true);
				break;
			case 2:
				rg_eye_4.check(1);
				rb_eye_yes_4.setChecked(true);
				break;
			}
		}
		if(tc4.getTwch_ear_appearance()>0){
			switch(tc4.getTwch_ear_appearance()){
			case 1:
				rg_ear_4.check(0);
				rb_ear_no_4.setChecked(true);
				break;
			case 2:
				rg_ear_4.check(1);
				rb_ear_yes_4.setChecked(true);
				break;
			}
		}
		
		if(tc4.getTwch_teething()>0){
			et_yashu_4.setText(tc4.getTwch_teething()+"");
		}
		if(tc4.getTwch_cavity()>0){
			et_quchi_4.setText(tc4.getTwch_cavity()+"");
		}
		if(tc4.getTwch_card()>0){
			switch(tc4.getTwch_card()){
			case 1:
				rg_card_4.check(0);
				rb_card_no_4.setChecked(true);
				break;
			case 2:
				rg_card_4.check(1);
				rb_card_yes_4.setChecked(true);
				break;
			}
		}
		if(tc4.getTwch_abdomen()>0){
			switch(tc4.getTwch_abdomen()){
			case 1:
				rg_fubu_4.check(0);
				rb_fubu_no_4.setChecked(true);
				break;
			case 2:
				rg_fubu_4.check(1);
				rb_fubu_yes_4.setChecked(true);
				break;
			}
		}
		if(tc4.getTwch_legs()>0){
			switch(tc4.getTwch_legs()){
			case 1:
				rg_leg_4.check(0);
				rb_leg_no_4.setChecked(true);
				break;
			case 2:
				rg_leg_4.check(1);
				rb_leg_yes_4.setChecked(true);
			}
		}
	}
	
	public boolean saveView(){
		if(et_weight_1.getText().toString().replaceAll("\\s", "").length()>10||
				et_weight_1.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_weight_1.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_weight_2.getText().toString().replaceAll("\\s", "").length()>10||
				et_weight_2.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_weight_2.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_weight_3.getText().toString().replaceAll("\\s", "").length()>10||
				et_weight_3.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_weight_3.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_weight_4.getText().toString().replaceAll("\\s", "").length()>10||
				et_weight_4.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_weight_4.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_height_1.getText().toString().replaceAll("\\s", "").length()>10||
				et_height_1.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_height_1.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_height_2.getText().toString().replaceAll("\\s", "").length()>10||
				et_height_2.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_height_2.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_height_3.getText().toString().replaceAll("\\s", "").length()>10||
				et_height_3.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_height_3.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_height_4.getText().toString().replaceAll("\\s", "").length()>10||
				et_height_4.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_height_4.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_qianxin_left_1.getText().toString().replaceAll("\\s", "").length()>10||
				et_qianxin_left_1.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_qianxin_left_1.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_qianxin_left_2.getText().toString().replaceAll("\\s", "").length()>10||
				et_qianxin_left_2.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_qianxin_left_2.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_qianxin_left_3.getText().toString().replaceAll("\\s", "").length()>10||
				et_qianxin_left_3.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_qianxin_left_3.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_qianxin_right_1.getText().toString().replaceAll("\\s", "").length()>10||
				et_qianxin_right_1.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_qianxin_right_1.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_qianxin_right_2.getText().toString().replaceAll("\\s", "").length()>10||
				et_qianxin_right_2.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_qianxin_right_2.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_qianxin_right_3.getText().toString().replaceAll("\\s", "").length()>10||
				et_qianxin_right_3.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_qianxin_right_3.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_yashu_1.getText().toString().replaceAll("\\s", "").length()>8||
				et_yashu_1.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_yashu_1.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_yashu_2.getText().toString().replaceAll("\\s", "").length()>8||
				et_yashu_2.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_yashu_2.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_yashu_3.getText().toString().replaceAll("\\s", "").length()>8||
				et_yashu_3.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_yashu_3.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_yashu_4.getText().toString().replaceAll("\\s", "").length()>8||
				et_yashu_4.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_yashu_4.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_quchi_1.getText().toString().replaceAll("\\s", "").length()>8||
				et_quchi_1.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_quchi_1.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_quchi_2.getText().toString().replaceAll("\\s", "").length()>8||
				et_quchi_2.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_quchi_2.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_quchi_3.getText().toString().replaceAll("\\s", "").length()>8||
				et_quchi_3.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_quchi_3.setError("输入的数据长度超过范围");
			return false;
		}
		if(et_quchi_4.getText().toString().replaceAll("\\s", "").length()>8||
				et_quchi_4.getText().toString().replaceAll("\\s", "").startsWith("-")){
			et_quchi_4.setError("输入的数据长度超过范围");
			return false;
		}
		TwoChild tc=new TwoChild(myContext);
		tc.selectTwoChild(profileid, 1);
		if(et_date_1.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_date(et_date_1.getText().toString().replaceAll("\\s", ""));
		}
		if(et_weight_1.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_weig_value(Float.parseFloat(et_weight_1.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_w_up_1.isChecked()){
			tc.setTwch_weig_choi(1);
		}
		else if(rb_w_middle_1.isChecked()){
			tc.setTwch_weig_choi(2);
		}
		else if(rb_w_down_1.isChecked()){
			tc.setTwch_weig_choi(3);
		}
		if(et_height_1.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_heig_value(Float.parseFloat(et_height_1.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_h_up_1.isChecked()){
			tc.setTwch_heig_choi(1);
		}
		else if(rb_h_middle_1.isChecked()){
			tc.setTwch_heig_choi(2);
		}
		else if(rb_h_down_1.isChecked()){
			tc.setTwch_heig_choi(3);
		}
		if(rb_hong_1.isChecked()){
			tc.setTwch_complexion(1);
		}
		else if(rb_other_1.isChecked()){
			tc.setTwch_complexion(2);
		}
		if(rb_skin_no_1.isChecked()){
			tc.setTwch_skin(1);
		}
		else if(rb_skin_yes_1.isChecked()){
			tc.setTwch_skin(2);
		}
		if(rb_qianxin_bihe_1.isChecked()){
			tc.setTwch_bregma_choi(1);
		}
		else if(rb_qianxin_weibi_1.isChecked()){
			tc.setTwch_bregma_choi(2);
		}
		if(et_qianxin_left_1.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_bregma_left(Float.parseFloat(et_qianxin_left_1.getText().toString().replaceAll("\\s", "")));
		}
		if(et_qianxin_right_1.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_bregma_right(Float.parseFloat(et_qianxin_right_1.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_eye_no_1.isChecked()){
			tc.setTwch_eye_appearance(1);
		}
		else if(rb_eye_yes_1.isChecked()){
			tc.setTwch_eye_appearance(2);
		}
		if(rb_ear_no_1.isChecked()){
			tc.setTwch_ear_appearance(1);
		}
		else if(rb_ear_yes_1.isChecked()){
			tc.setTwch_ear_appearance(2);
		}
		if(rb_hearing_pass_1.isChecked()){
			tc.setTwch_hearing(1);
		}
		else if(rb_hearing_nopass_1.isChecked()){
			tc.setTwch_hearing(2);
		}
		if(et_yashu_1.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_teething(Integer.parseInt(et_yashu_1.getText().toString().replaceAll("\\s", "")));
		}
		if(et_quchi_1.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_cavity(Integer.parseInt(et_quchi_1.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_card_no_1.isChecked()){
			tc.setTwch_card(1);
		}
		else if(rb_card_yes_1.isChecked()){
			tc.setTwch_card(2);
		}
		if(rb_fubu_no_1.isChecked()){
			tc.setTwch_abdomen(1);
		}
		else if(rb_fubu_yes_1.isChecked()){
			tc.setTwch_abdomen(2);
		}
		if(rb_leg_no_1.isChecked()){
			tc.setTwch_legs(1);
		}
		else if(rb_leg_yes_1.isChecked()){
			tc.setTwch_legs(2);
		}
		tc.updateTwoChild(profileid, 1);
		//18
		tc.selectTwoChild(profileid, 2);
		if(et_date_2.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_date(et_date_2.getText().toString().replaceAll("\\s", ""));
		}
		if(et_weight_2.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_weig_value(Float.parseFloat(et_weight_2.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_w_up_2.isChecked()){
			tc.setTwch_weig_choi(1);
		}
		else if(rb_w_middle_2.isChecked()){
			tc.setTwch_weig_choi(2);
		}
		else if(rb_w_down_2.isChecked()){
			tc.setTwch_weig_choi(3);
		}
		if(et_height_2.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_heig_value(Float.parseFloat(et_height_2.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_h_up_2.isChecked()){
			tc.setTwch_heig_choi(1);
		}
		else if(rb_h_middle_2.isChecked()){
			tc.setTwch_heig_choi(2);
		}
		else if(rb_h_down_2.isChecked()){
			tc.setTwch_heig_choi(3);
		}
		if(rb_hong_2.isChecked()){
			tc.setTwch_complexion(1);
		}
		else if(rb_other_2.isChecked()){
			tc.setTwch_complexion(2);
		}
		if(rb_skin_no_2.isChecked()){
			tc.setTwch_skin(1);
		}
		else if(rb_skin_yes_2.isChecked()){
			tc.setTwch_skin(2);
		}
		if(rb_qianxin_bihe_2.isChecked()){
			tc.setTwch_bregma_choi(1);
		}
		else if(rb_qianxin_weibi_2.isChecked()){
			tc.setTwch_bregma_choi(2);
		}
		if(et_qianxin_left_2.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_bregma_left(Float.parseFloat(et_qianxin_left_2.getText().toString().replaceAll("\\s", "")));
		}
		if(et_qianxin_right_2.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_bregma_right(Float.parseFloat(et_qianxin_right_2.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_eye_no_2.isChecked()){
			tc.setTwch_eye_appearance(1);
		}
		else if(rb_eye_yes_2.isChecked()){
			tc.setTwch_eye_appearance(2);
		}
		if(rb_ear_no_2.isChecked()){
			tc.setTwch_ear_appearance(1);
		}
		else if(rb_ear_yes_2.isChecked()){
			tc.setTwch_ear_appearance(2);
		}
		if(et_yashu_2.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_teething(Integer.parseInt(et_yashu_2.getText().toString().replaceAll("\\s", "")));
		}
		if(et_quchi_2.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_cavity(Integer.parseInt(et_quchi_2.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_card_no_2.isChecked()){
			tc.setTwch_card(1);
		}
		else if(rb_card_yes_2.isChecked()){
			tc.setTwch_card(2);
		}
		if(rb_fubu_no_2.isChecked()){
			tc.setTwch_abdomen(1);
		}
		else if(rb_fubu_yes_2.isChecked()){
			tc.setTwch_abdomen(2);
		}
		if(rb_leg_no_2.isChecked()){
			tc.setTwch_legs(1);
		}
		else if(rb_leg_yes_2.isChecked()){
			tc.setTwch_legs(2);
		}
		tc.updateTwoChild(profileid, 2);
		//24
		tc.selectTwoChild(profileid, 3);
		if(et_date_3.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_date(et_date_3.getText().toString().replaceAll("\\s", ""));
		}
		if(et_weight_3.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_weig_value(Float.parseFloat(et_weight_3.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_w_up_3.isChecked()){
			tc.setTwch_weig_choi(1);
		}
		else if(rb_w_middle_3.isChecked()){
			tc.setTwch_weig_choi(2);
		}
		else if(rb_w_down_3.isChecked()){
			tc.setTwch_weig_choi(3);
		}
		if(et_height_3.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_heig_value(Float.parseFloat(et_height_3.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_h_up_3.isChecked()){
			tc.setTwch_heig_choi(1);
		}
		else if(rb_h_middle_3.isChecked()){
			tc.setTwch_heig_choi(2);
		}
		else if(rb_h_down_3.isChecked()){
			tc.setTwch_heig_choi(3);
		}
		if(rb_hong_3.isChecked()){
			tc.setTwch_complexion(1);
		}
		else if(rb_other_3.isChecked()){
			tc.setTwch_complexion(2);
		}
		if(rb_skin_no_3.isChecked()){
			tc.setTwch_skin(1);
		}
		else if(rb_skin_yes_3.isChecked()){
			tc.setTwch_skin(2);
		}
		if(rb_qianxin_bihe_3.isChecked()){
			tc.setTwch_bregma_choi(1);
		}
		else if(rb_qianxin_weibi_3.isChecked()){
			tc.setTwch_bregma_choi(2);
		}
		if(et_qianxin_left_3.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_bregma_left(Float.parseFloat(et_qianxin_left_3.getText().toString().replaceAll("\\s", "")));
		}
		if(et_qianxin_right_3.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_bregma_right(Float.parseFloat(et_qianxin_right_3.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_eye_no_3.isChecked()){
			tc.setTwch_eye_appearance(1);
		}
		else if(rb_eye_yes_3.isChecked()){
			tc.setTwch_eye_appearance(2);
		}
		if(rb_ear_no_3.isChecked()){
			tc.setTwch_ear_appearance(1);
		}
		else if(rb_ear_yes_3.isChecked()){
			tc.setTwch_ear_appearance(2);
		}
		if(rb_hearing_pass_3.isChecked()){
			tc.setTwch_hearing(1);
		}
		else if(rb_hearing_nopass_3.isChecked()){
			tc.setTwch_hearing(2);
		}
		if(et_yashu_3.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_teething(Integer.parseInt(et_yashu_3.getText().toString().replaceAll("\\s", "")));
		}
		if(et_quchi_3.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_cavity(Integer.parseInt(et_quchi_3.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_card_no_3.isChecked()){
			tc.setTwch_card(1);
		}
		else if(rb_card_yes_3.isChecked()){
			tc.setTwch_card(2);
		}
		if(rb_fubu_no_3.isChecked()){
			tc.setTwch_abdomen(1);
		}
		else if(rb_fubu_yes_3.isChecked()){
			tc.setTwch_abdomen(2);
		}
		if(rb_leg_no_3.isChecked()){
			tc.setTwch_legs(1);
		}
		else if(rb_leg_yes_3.isChecked()){
			tc.setTwch_legs(2);
		}
		tc.updateTwoChild(profileid, 3);
		//30
		tc.selectTwoChild(profileid, 4);
		if(et_date_4.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_date(et_date_4.getText().toString().replaceAll("\\s", ""));
		}
		if(et_weight_4.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_weig_value(Float.parseFloat(et_weight_4.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_w_up_4.isChecked()){
			tc.setTwch_weig_choi(1);
		}
		else if(rb_w_middle_4.isChecked()){
			tc.setTwch_weig_choi(2);
		}
		else if(rb_w_down_4.isChecked()){
			tc.setTwch_weig_choi(3);
		}
		if(et_height_4.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_heig_value(Float.parseFloat(et_height_4.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_h_up_4.isChecked()){
			tc.setTwch_heig_choi(1);
		}
		else if(rb_h_middle_4.isChecked()){
			tc.setTwch_heig_choi(2);
		}
		else if(rb_h_down_4.isChecked()){
			tc.setTwch_heig_choi(3);
		}
		if(rb_hong_4.isChecked()){
			tc.setTwch_complexion(1);
		}
		else if(rb_other_4.isChecked()){
			tc.setTwch_complexion(2);
		}
		if(rb_skin_no_4.isChecked()){
			tc.setTwch_skin(1);
		}
		else if(rb_skin_yes_4.isChecked()){
			tc.setTwch_skin(2);
		}
		if(rb_eye_no_4.isChecked()){
			tc.setTwch_eye_appearance(1);
		}
		else if(rb_eye_yes_4.isChecked()){
			tc.setTwch_eye_appearance(2);
		}
		if(rb_ear_no_4.isChecked()){
			tc.setTwch_ear_appearance(1);
		}
		else if(rb_ear_yes_4.isChecked()){
			tc.setTwch_ear_appearance(2);
		}
		if(et_yashu_4.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_teething(Integer.parseInt(et_yashu_4.getText().toString().replaceAll("\\s", "")));
		}
		if(et_quchi_4.getText().toString().replaceAll("\\s", "").length()>0){
			tc.setTwch_cavity(Integer.parseInt(et_quchi_4.getText().toString().replaceAll("\\s", "")));
		}
		if(rb_card_no_4.isChecked()){
			tc.setTwch_card(1);
		}
		else if(rb_card_yes_4.isChecked()){
			tc.setTwch_card(2);
		}
		if(rb_fubu_no_4.isChecked()){
			tc.setTwch_abdomen(1);
		}
		else if(rb_fubu_yes_4.isChecked()){
			tc.setTwch_abdomen(2);
		}
		if(rb_leg_no_4.isChecked()){
			tc.setTwch_legs(1);
		}
		else if(rb_leg_yes_4.isChecked()){
			tc.setTwch_legs(2);
		}
		tc.updateTwoChild(profileid, 4);
		return true;
	}
	
	class MyView extends View {
    	View v;
    	Paint paint;
    	
		public MyView(Context context) {
			super(context);
			paint=new Paint();
			paint.setStyle(Paint.Style.STROKE);
            paint.setColor(Color.BLACK);
		}
		
		@Override
		public void onDraw(Canvas c){
	        int top=ll1.getTop();
	        int left=ll1.getLeft()-15;
	        int right=ll1.getRight()+15;
	        int bottom=ll1.getBottom();
	        int y=0;//sv.getScrollY();
	        int height=rb_w_up_1.getHeight();
	        int height2=et_name.getHeight();
	        top=top-y;
	        bottom=bottom-y;
	        
	        c.drawLine(left, top+130, right, top+130, paint);
	        c.drawLine(left, top+130+40+1*height, right, top+130+40+1*height, paint);	 
	        c.drawLine(left, top+130+2*40+1*height+1*height2, right, top+130+2*40+1*height+1*height2, paint);
	        c.drawLine(left, top+145+3*40+2*height+2*height2, right, top+145+3*40+2*height+2*height2, paint);
	        c.drawLine(left, top+160+4*40+3*height+3*height2, right, top+160+4*40+3*height+3*height2, paint);
	        c.drawLine(left+35, top+160+5*40+4*height+3*height2, right, top+160+5*40+4*height+3*height2, paint);
	        c.drawLine(left+35, top+160+6*40+5*height+3*height2, right, top+160+6*40+5*height+3*height2, paint);
	        c.drawLine(left+35, top+175+7*40+6*height+4*height2, right, top+175+7*40+6*height+4*height2, paint);
	        c.drawLine(left+35, top+175+8*40+7*height+4*height2, right, top+175+8*40+7*height+4*height2, paint);
	        c.drawLine(left+35, top+175+9*40+8*height+4*height2, right, top+175+9*40+8*height+4*height2, paint);
	        c.drawLine(left+35, top+175+10*40+9*height+4*height2, right, top+175+10*40+9*height+4*height2, paint);
	        c.drawLine(left+35, top+175+11*40+9*height+5*height2, right, top+175+11*40+9*height+5*height2, paint);
	        c.drawLine(left+35, top+175+12*40+10*height+5*height2, right, top+175+12*40+10*height+5*height2, paint);
	        c.drawLine(left+35, top+175+13*40+11*height+5*height2, right, top+175+13*40+11*height+5*height2, paint);
	        c.drawLine(left, top+175+14*40+12*height+5*height2, right, top+175+14*40+12*height+5*height2, paint);
	        
	        c.drawLine(left,top+130, left, top+175+14*40+12*height+5*height2, paint);
	        c.drawLine(right,top+130, right, top+175+14*40+12*height+5*height2, paint);
	        c.drawLine(left+115,top+130, left+115, top+175+14*40+12*height+5*height2, paint);
	        c.drawLine(left+275,top+130, left+275, top+175+14*40+12*height+5*height2, paint);
	        c.drawLine(left+435,top+130, left+435, top+175+14*40+12*height+5*height2, paint);
	        c.drawLine(left+595,top+130, left+595, top+175+14*40+12*height+5*height2, paint);
	        
	        c.drawLine(left+35,top+160+4*40+3*height+3*height2, left+35, top+175+14*40+12*height+5*height2, paint);
		}
    	
    }

	@Override
	public void onClick(View arg0) {
		// TODO Auto-generated method stub
		if(v==et_date_1){
			mPopupWindow = new MyPopupWindow(myContext);			
			mPopupWindow.showAtLocation(v.findViewById(R.id.et_tc_date_1), Gravity.CENTER, 0, 0);

			Button btn=mPopupWindow.getButton();
			btn.setOnClickListener(new OnClickListener(){

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					et_date_1.setText(mPopupWindow.getDate());
					mPopupWindow.dismiss();
				}
				
			});
		}
		else if(v==et_date_2){
			mPopupWindow = new MyPopupWindow(myContext);			
			mPopupWindow.showAtLocation(v.findViewById(R.id.et_tc_date_2), Gravity.CENTER, 0, 0);

			Button btn=mPopupWindow.getButton();
			btn.setOnClickListener(new OnClickListener(){

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					et_date_2.setText(mPopupWindow.getDate());
					mPopupWindow.dismiss();
				}
				
			});
		}
		else if(v==et_date_3){
			mPopupWindow = new MyPopupWindow(myContext);			
			mPopupWindow.showAtLocation(v.findViewById(R.id.et_tc_date_3), Gravity.CENTER, 0, 0);

			Button btn=mPopupWindow.getButton();
			btn.setOnClickListener(new OnClickListener(){

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					et_date_3.setText(mPopupWindow.getDate());
					mPopupWindow.dismiss();
				}
				
			});
		}
		else if(v==et_date_4){
			mPopupWindow = new MyPopupWindow(myContext);			
			mPopupWindow.showAtLocation(v.findViewById(R.id.et_tc_date_4), Gravity.CENTER, 0, 0);

			Button btn=mPopupWindow.getButton();
			btn.setOnClickListener(new OnClickListener(){

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					et_date_4.setText(mPopupWindow.getDate());
					mPopupWindow.dismiss();
				}
				
			});
		}
	}

	@Override
	public void onFocusChange(View v, boolean hasFocus) {
		// TODO Auto-generated method stub
		 if(v==et_date_1&&hasFocus){
			mPopupWindow = new MyPopupWindow(getContext());			
			mPopupWindow.showAtLocation(v.findViewById(R.id.et_tc_date_1  ), Gravity.CENTER, 0, 0);

			Button btn=mPopupWindow.getButton();
			btn.setOnClickListener(new OnClickListener(){

				@Override
				public void onClick(View v) {
					// TODO Auto-generated method stub
					et_date_1.setText(mPopupWindow.getDate());
					mPopupWindow.dismiss();
				}
				
			});
		}
		 else if(v==et_date_2&&hasFocus){
				mPopupWindow = new MyPopupWindow(getContext());			
				mPopupWindow.showAtLocation(v.findViewById(R.id.et_tc_date_2  ), Gravity.CENTER, 0, 0);

				Button btn=mPopupWindow.getButton();
				btn.setOnClickListener(new OnClickListener(){

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						et_date_2.setText(mPopupWindow.getDate());
						mPopupWindow.dismiss();
					}
					
				});
			}
		 else if(v==et_date_3&&hasFocus){
				mPopupWindow = new MyPopupWindow(getContext());			
				mPopupWindow.showAtLocation(v.findViewById(R.id.et_tc_date_3  ), Gravity.CENTER, 0, 0);

				Button btn=mPopupWindow.getButton();
				btn.setOnClickListener(new OnClickListener(){

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						et_date_3.setText(mPopupWindow.getDate());
						mPopupWindow.dismiss();
					}
					
				});
			}
		 else if(v==et_date_4&&hasFocus){
				mPopupWindow = new MyPopupWindow(getContext());			
				mPopupWindow.showAtLocation(v.findViewById(R.id.et_tc_date_4  ), Gravity.CENTER, 0, 0);

				Button btn=mPopupWindow.getButton();
				btn.setOnClickListener(new OnClickListener(){

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						et_date_4.setText(mPopupWindow.getDate());
						mPopupWindow.dismiss();
					}
					
				});
			}
	}
}
